<template>
  <div class="content">
    <div v-html="text"></div>
  </div>
</template>

<script>
import { getBannerDetails } from '@/api/api';
export default {
  props: {},
  data () {
    return {
      text: ''
    };
  },
  computed: {},
  created () {},
  mounted () {
    this.id = this.$root.$mp.query.id;
    // 从banner过来的
    if (this.id) {
      this.getBannerDetails(this.id);
    }
  },
  watch: {},
  methods: {
    /**
     * 从banner过来的商品详情
     */
    async getBannerDetails (id) {
      wx.showLoading({
        title: '加载中',
        mask: true
      });
      let data = await getBannerDetails({ id: id });
      wx.hideLoading();
      this.text = data.content;
    }
  },
  components: {}
};
</script>

<style scoped lang="less">
.content {
  margin: 0 15px 15px;
  font-size: 14px;
}
</style>
